package com.mpsc.singleton.demo.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.mpsc.singleton.demo.vo.UserVo;

import java.util.Map;

public class ExcelListener extends AnalysisEventListener<UserVo> {

    //一行一行读取excel内容
    @Override
    public void invoke(UserVo demoData, AnalysisContext analysisContext) {
        System.out.println("excel内容：" + demoData);
    }

    //读取excel表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头：" + headMap);
    }

    //读取完之后执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("读完啦、。。。，");
    }
}

